<template>
  <div>
    <button :style="{ color: color }" @click="action">{{ title }}</button>
    <input type="text" v-model="modelValue.id" />
  </div>
</template>

<script setup>
import { getCurrentInstance } from "vue";

const $props = defineProps({
  title: {
    type: String,
    default: "title",
  },
  color: {
    type: String,
    default: "blue",
  },
  /* modelValue: {
    type: Object,
    default: () => ({}),
  }, */
});

defineModel("modelValue");

const $emits = defineEmits(["subClick"]);
const current = getCurrentInstance();
const action = () => {
  $emits("subClick", "子组件点击");
  console.log(current.parent);
};
</script>

<style scoped></style>
